package cn.kgc;

import org.elasticsearch.client.transport.TransportClient;
import org.elasticsearch.common.settings.Settings;
import org.elasticsearch.common.transport.TransportAddress;
import org.elasticsearch.transport.client.PreBuiltTransportClient;

import java.net.InetAddress;
import java.net.UnknownHostException;


/**
 * Hello world!
 */
public class App {
    private static TransportClient client = null;
    static {
        try {
             client = new PreBuiltTransportClient(Settings.EMPTY)
                    .addTransportAddress(new TransportAddress(InetAddress.getByName("192.168.79.140"), 9300));
            System.out.println("连接成功！");
            System.out.println(client);
        } catch (Exception e) {
            e.printStackTrace();
        }
    }



    /**
     * 添加索引
     */
    public static void addIndex() {
    }

    public static void addIndexAndSet() {
    }


    public static void main(String[] args) {

    }
}
